how can i convert array of objects to one object